def transformList(list: List[Int]): List[Int] = {
 list.map(x => 
    if (x % 2 == 0) 
      x / 2
    else x + 1)
}
println(transformList(List(2,3))) //[1,4]
println(transformList(List(1,2,3,5,6))) //[2,1,4,6,3]
